//
//  KSPickerPhotoCollectionViewCell.swift
//  Supermarket
//
//  Created by Black_Crystal on 2017/9/19.
//  Copyright © 2017年 kushao. All rights reserved.
//

import UIKit

class KSPickerPhotoCollectionViewCell: UICollectionViewCell {
    var imageView: UIImageView!
    private var selectedIcon: UIImageView!
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        imageView = UIImageView()
        self.contentView.addSubview(imageView)
        imageView.snp.makeConstraints { (make) in
            make.edges.equalTo(UIEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0))
        }
        
        selectedIcon = UIImageView.init(frame: CGRect.init(x: 0, y: 0, width: 20, height: 20))
        self.contentView.addSubview(selectedIcon)
    }
    
    func setSelectImage(iselected: Bool) {
        if iselected {
            selectedIcon.image = UIImage(named: "success")
        }else{
            selectedIcon.image = UIImage(named: "")
        }
    }
    
    required init(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
